package JBANK;

/**
 * 
 * Account Class | JBANK
 * 
 * 
 */

public class Account{

	private char acctType;
	private double balance;
	private String acctId;


	public Account(){

		acctType = 's';
		balance = 100.00;
		
	}

	public Account(double b){

		balance = b;
	}

	public char getAcctType(){

		return acctType;

	}

	public double getBalance(){


		return balance;

	}

	public String getID(){

		return acctId;

	}

	public void setBalance(double amount){

		balance = amount;

	}

	public void setID(String id){

		acctId = id;
	}

	public void setAcctType(char type){

		acctType = type;

	}
	public boolean deposit(double dAmount){

		if (dAmount > 0){

			balance += dAmount;
			System.out.println("Deposit.: "+dAmount);
			System.out.println("Current Balance.: "+getBalance());
			return true;

		}else   

		{
			System.out.println("The value of the Deposit is invalid");
			return false;
		}
	}

	public boolean withdraw(double dWithdraw){

		if(balance-dWithdraw < 0){

			System.out.println("You cant' withdraw this amount.: "+dWithdraw+
					"\n"+"Your Balance is.: "+balance+
					"\n"+"Please, Try to withdraw a minor amount");
			return false;

		}else {

			balance -= dWithdraw;
			System.out.println("Withdraw.: "+dWithdraw);
			System.out.println("Current Balance.: "+balance);
			return true;

		}


	}
}